{extend name="layout/layout" /}

{block name="content"}
<link href="__STATIC__/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css" rel="stylesheet" type="text/css" />
<style>
    .areaspan{
        margin: 10px 8px auto auto;
        display: inline-block;
        border: #eee solid 1px;
        width: auto;
        padding-left: 8px;
        padding-right: 8px;
        height: 34px;
        line-height: 34px;
        text-align: center;
    }

    .mt-repeater-cell {
        margin-top: 10px;
    }
</style>
<div class="row">
    <div class="col-md-12">
        <div class="portlet light">
            <div class="portlet-title">
                <div class="caption">
                    <i class="icon-share font-dark"></i>
                    <span class="caption-subject font-dark bold uppercase"> 新增督办</span>
                </div>
                <div class="actions">
                    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" data-original-title="" title=""> </a>
                </div>
            </div>
            <div class="portlet-body">
                <form class="form-horizontal" method="post" enctype="multipart/form-data">
                    <div class="form-body">


                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        工作类型
                                    </label>
                                    <div class="col-md-9 istypeId">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="typeId" value="1" checked>
                                                内部工作
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="typeId" value="2">
                                                信访工作
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="xinfangjian hide">
                            <div class="row">
                                <div class="col-md-9">
                                    <div class="form-group">
                                        <label class="control-label col-md-3">
                                            选择信访
                                        </label>
                                        <div class="col-md-9">
                                            <select class="form-control" name="letterId">
                                                <option value="0">请选择信访件</option>
                                                {volist name="letter" id="vo"}
                                                <option value="{$vo.id}">{$vo.title}</option>
                                                {/volist}

                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        督办标题
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-3">
                                        <input type="text" class="form-control input-large" id="title" data-required="1" name="title" maxlength="80" value="">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        紧急程度
                                    </label>
                                    <div class="col-md-9">
                                        <div class="mt-radio-inline">
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="urgency_degree" value="1" checked>
                                                一般日常
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="urgency_degree" value="2">
                                                紧急
                                                <span></span>
                                            </label>
                                            <label class="mt-radio mt-radio-outline">
                                                <input type="radio" class="" name="urgency_degree" value="3">
                                                临时加急
                                                <span></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group mt-repeater">
                                    <label class="control-label col-md-3">
                                        附件
                                    </label>
                                    <div class="col-md-9">
                                        <div id="upload-image">
                                            <span id="upload-btn" data-multi="true" data-ajax="true" data-field="enclosure" data-extensions="jpg,jpeg,png,pdf,mp3,mp4">
                                                <img src="__STATIC__/admin/img/defaultup.png" alt="附件上传" style="width: 100px;height: 100px;" />
                                            </span>
                                            <span>（只支持jpg,jpeg,png,pdf,mp3,mp4格式的文件）</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        指派给
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <div class="form-inline">
                                            <select class="form-control areaLists" name="departmentId" onchange="getPensonList(this,type='pensonList')" >
                                                <option value="0">请选择</option>
                                                {volist name="department" id="vo"}
                                                <option value="{$vo.id}">{$vo.name}</option>
                                                {/volist}
                                            </select>
                                            <select class="form-control pensonList areaLists" name="personId" onchange="showPeson(this)"></select>
                                            <span style="color: #9a9a9a">（会下发短信提醒指派人）</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                    </label>
                                    <div class="col-md-9">
                                        <div id="cover-image">
                                            <div id="personlist" data-multi="true" data-field="imgUrls"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        完成时间
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-4">
                                        <input type="text" class="form-control complete_time" name="complete_time" value="" placeholder="选择日期" autocomplete="off" readonly>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        工作要求
                                        <span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <textarea class="form-control" cols="80" rows="5" name="introduction" placeholder="请输入详情"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="posttype" value="add">
                        <hr />
                        <div class="row">
                            <div class="form-actions">
                                <div class="col-md-offset-2 col-md-10">
                                    <button type="button" id="form-submit" class="btn blue save-btn">
                                        保存 <i class="fa fa-floppy-o"></i>
                                    </button>
                                    <button type="button" class="btn default" onclick="history.go(-1);">
                                        返回 <i class="fa fa-mail-forward"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<input type="hidden" class="token_url" value="{:url('admin/Image/token')}">
<input type="hidden" class="record_url" value="{:url('admin/Image/record')}">
<input type="hidden" class="delimage_url" value="{:url('admin/Image/delete')}">
<input type="hidden" class="save_url" value="{:url('admin/supervision/addPost')}">
{/block}

{block name="pagescript"}
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/addpost')}";
    var getPensonListurl = "{:url('admin/layer/getPensonList')}";
    var getPersonurl = "{:url('admin/layer/getPenson')}";
    var villageurl = "{:url('admin/layer/getVillage')}";
</script>
<script src="__STATIC__/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/uploadfile01.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/supervision.js?v={:time()}" type="text/javascript"></script>
{/block}